home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / comms / internet / html-related / hsc / source / hsclib / hscprc.c < prev    next >
C/C++ Source or Header  |  1996-09-08  |  15KB  |  689 lines

  1. /*
  2.  * hscprc.c
  3.  *
  4.  * hsc process functions
  5.  *
  6.  * Copyright (C) 1995,96  Thomas Aglassinger
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * updated:  8-Sep-1996
  23.  * created: 11-Feb-1996
  24.  */
  25.  
  26. #define NOEXTERN_HSCLIB_HSCPRC
  27.  
  28. #include "hsclib/inc_base.h"
  29.  
  30. #include "ugly/fname.h"
  31. #include "ugly/returncd.h"
  32.  
  33. #include "hscprj/project.h"
  34.  
  35. #include "hsclib/idref.h"
  36. #include "hsclib/tag_if.h"
  37.  
  38. /*
  39.  * del_inpf_stack_node
  40.  *
  41.  * remove node from input file stack
  42.  */
  43. static VOID del_inpf_stack_node(APTR data)
  44. {
  45.     /* do nufin */
  46. }
  47.  
  48. /*
  49.  * del_hscprc
  50.  *
  51.  * remove hsc process and all it's resources
  52.  */
  53. VOID del_hscprc(HSCPRC * hp)
  54. {
  55.     if (hp)
  56.     {
  57.         /* remove list */
  58.         del_dllist(hp->defent);
  59.         del_dllist(hp->deftag);
  60.         del_dllist(hp->defattr);
  61.         del_dllist(hp->container_stack);
  62.         del_dllist(hp->inpf_stack);
  63.         del_dllist(hp->idrefs);
  64.         del_dllist(hp->select_stack);
  65.  
  66.         /* remove strings */
  67.         del_estr(hp->destdir);
  68.         del_estr(hp->reldir);
  69.         del_estr(hp->iconbase);
  70.         del_estr(hp->if_stack);
  71.         del_estr(hp->tag_name_str);
  72.         del_estr(hp->tag_attr_str);
  73.         del_estr(hp->tag_close_str);
  74.         del_estr(hp->tmpstr);
  75.         del_estr(hp->rmt_str);
  76.         del_estr(hp->curr_msg);
  77.         del_estr(hp->curr_ref);
  78.  
  79. #if 0                           /* TODO:remove */
  80.         ufreestr(hp->filename_project);
  81. #endif
  82.         ufreestr(hp->filename_document);
  83.  
  84.         /* remove project-data */
  85.         del_project(hp->project);
  86.  
  87.         /* close input files */
  88.         infclose(hp->inpf);
  89.  
  90.         /* remove message arrays */
  91.         ufree(hp->msg_ignore);
  92.         ufree(hp->msg_class);
  93.  
  94.         ufree(hp);
  95.     }
  96. }
  97.  
  98. /*
  99.  * reset_hscprc
  100.  *
  101.  * reset all items of a hsc process
  102.  */
  103. static VOID reset_hscprc(HSCPRC * hp)
  104. {
  105.     int i;
  106.  
  107.     /* get current time */
  108.     hp->start_time = time(NULL);
  109.  
  110.     /* reset strings */
  111.     clr_estr(hp->destdir);
  112.     clr_estr(hp->reldir);
  113.     clr_estr(hp->if_stack);
  114.  
  115.     hp->suppress_output = TRUE;
  116.     hp->fatal = FALSE;
  117.     hp->prev_heading_num = 0;
  118.     hp->prev_status_line = (ULONG) - 1;
  119.     hp->msg_count = 0;
  120.  
  121.     hp->preceding_whtspc = FALSE;
  122.  
  123.     hp->inside_pre = FALSE;
  124.     hp->inside_anchor = FALSE;
  125.     hp->inside_title = FALSE;
  126.  
  127.     /* reset message arrays */
  128.     for (i = 0; i < MAX_MSGID; i++)
  129.     {
  130.         hp->msg_ignore[i] = FALSE;
  131.         hp->msg_class[i] = MSG_NOTE;
  132.     }
  133. }
  134.  
  135. /*
  136.  * new_hscprc
  137.  *
  138.  * create and init a new hsc process
  139.  */
  140. HSCPRC *new_hscprc(void)
  141. {
  142.     HSCPRC *hp = NULL;
  143.  
  144.     hp = (HSCPRC *) umalloc(sizeof(HSCPRC));
  145.     if (hp)
  146.     {
  147.         memset(hp, 0, sizeof(HSCPRC));
  148.  
  149.         /* init lists */
  150.         hp->defent = init_dllist(del_entity);
  151.         hp->deftag = init_dllist(del_hsctag);
  152.         hp->defattr = init_dllist(del_hscattr);
  153.         hp->container_stack = init_dllist(del_hsctag);
  154.         hp->inpf_stack = init_dllist(del_inpf_stack_node);
  155.         hp->project = NULL;
  156.         hp->idrefs = init_dllist(del_idref);
  157.         hp->select_stack = init_dllist(del_select_stack_node);
  158.  
  159.         /* init strings */
  160.         hp->destdir = init_estr(0);
  161.         hp->reldir = init_estr(0);
  162.         hp->iconbase = init_estr(0);
  163.         hp->if_stack = init_estr(0);
  164.         hp->tag_name_str = init_estr(128);
  165.         hp->tag_attr_str = init_estr(128);
  166.         hp->tag_close_str = init_estr(0);
  167.         hp->tmpstr = init_estr(0);
  168.         hp->rmt_str = init_estr(128);
  169.         hp->curr_msg = init_estr(64);
  170.         hp->curr_ref = init_estr(64);
  171.  
  172. #if 0                           /* TODO:remove */
  173.         hp->filename_project = NULL;
  174.         hp->filename_document = NULL;
  175. #endif
  176.  
  177.         /* alloc message arrays */
  178.         hp->msg_ignore = (BOOL *)
  179.             umalloc((MAX_MSGID + 1) * sizeof(BOOL));
  180.         hp->msg_class = (HSCMSG_CLASS *)
  181.             umalloc((MAX_MSGID + 1) * sizeof(HSCMSG_CLASS));
  182.  
  183.         reset_hscprc(hp);
  184.     }
  185.     return (hp);
  186. }
  187.  
  188. /*
  189.  *
  190.  * GET-methodes for public item of HSCPRC
  191.  *
  192.  */
  193.  
  194. /*
  195.  * get flags
  196.  */
  197. BOOL hsc_get_chkid(HSCPRC * hp)
  198. {
  199.     return (hp->chkid);
  200. }
  201.  
  202. BOOL hsc_get_chkuri(HSCPRC * hp)
  203. {
  204.     return (hp->chkuri);
  205. }
  206.  
  207. BOOL hsc_get_compact(HSCPRC * hp)
  208. {
  209.     return (hp->compact);
  210. }
  211.  
  212. BOOL hsc_get_debug(HSCPRC * hp)
  213. {
  214.     return (hp->debug);
  215. }
  216.  
  217. BOOL hsc_get_getsize(HSCPRC * hp)
  218. {
  219.     return (hp->getsize);
  220. }
  221.  
  222. BOOL hsc_get_htmlonly(HSCPRC * hp)
  223. {
  224.     return (hp->htmlonly);
  225. }
  226.  
  227. BOOL hsc_get_jens(HSCPRC * hp)
  228. {
  229.     return (hp->jens);
  230. }
  231.  
  232. BOOL hsc_get_jerkvalues(HSCPRC * hp)
  233. {
  234.     return (hp->jerkvalues);
  235. }
  236.  
  237. BOOL hsc_get_rplc_ent(HSCPRC * hp)
  238. {
  239.     return (hp->rplc_ent);
  240. }
  241.  
  242. BOOL hsc_get_rplc_quote(HSCPRC * hp)
  243. {
  244.     return (hp->rplc_quote);
  245. }
  246.  
  247. BOOL hsc_get_smart_ent(HSCPRC * hp)
  248. {
  249.     return (hp->smart_ent);
  250. }
  251.  
  252. BOOL hsc_get_strip_cmt(HSCPRC * hp)
  253. {
  254.     return (hp->strip_cmt);
  255. }
  256.  
  257. BOOL hsc_get_strip_ext(HSCPRC * hp)
  258. {
  259.     return (hp->strip_ext);
  260. }
  261.  
  262. /*
  263.  * get internal flags
  264.  */
  265. BOOL hsc_get_suppress_output(HSCPRC * hp)
  266. {
  267.     return (hp->suppress_output);
  268. }
  269.  
  270. BOOL hsc_get_inside_pre(HSCPRC * hp)
  271. {
  272.     return (hp->inside_pre);
  273. }
  274.  
  275. BOOL hsc_get_inside_anchor(HSCPRC * hp)
  276. {
  277.     return (hp->inside_anchor);
  278. }
  279.  
  280. BOOL hsc_get_fatal(HSCPRC * hp)
  281. {
  282.     return (hp->fatal);
  283. }
  284.  
  285. /*
  286.  * get values
  287.  */
  288. STRPTR hsc_get_destdir(HSCPRC * hp)
  289. {
  290.     return (estr2str(hp->destdir));
  291. }
  292.  
  293. STRPTR hsc_get_reldir(HSCPRC * hp)
  294. {
  295.     return (estr2str(hp->reldir));
  296. }
  297.  
  298. STRPTR hsc_get_iconbase(HSCPRC * hp)
  299. {
  300.     return (estr2str(hp->iconbase));
  301. }
  302.  
  303. /*
  304.  * get internal values
  305.  */
  306. STRPTR hsc_get_click_here_str(HSCPRC * hp)
  307. {
  308.     return (hp->click_here_str);
  309. }
  310.  
  311. STRPTR hsc_get_file_name(HSCPRC * hp)
  312. {
  313.     if (hp->inpf)
  314.         return (infget_fname(hp->inpf));
  315.     else
  316.         return (NULL);
  317. }
  318.  
  319. ULONG hsc_get_file_line(HSCPRC * hp)
  320. {
  321.     if (hp->inpf)
  322.         return (infget_y(hp->inpf));
  323.     else
  324.         return (0);
  325. }
  326.  
  327. ULONG hsc_get_file_column(HSCPRC * hp)
  328. {
  329.     if (hp->inpf)
  330.         return (infget_x(hp->inpf));
  331.     else
  332.         return (0);
  333. }
  334.  
  335. ULONG hsc_get_msg_count(HSCPRC * hp)
  336. {
  337.     return (hp->msg_count);
  338. }
  339.  
  340. /*
  341.  *
  342.  * SET-methodes for public item of HSCPRC
  343.  *
  344.  */
  345.  
  346. /*
  347.  * set values
  348.  */
  349. BOOL hsc_set_destdir(HSCPRC * hp, STRPTR dir)
  350. {
  351.     set_estr(hp->destdir, dir);
  352.     /* append "/" if neccessary */
  353.     link_fname(hp->destdir, estr2str(hp->destdir), "");
  354.     D(fprintf(stderr, DHL "destdir=`%s'\n", estr2str(hp->destdir)));
  355.  
  356.     return (TRUE);
  357. }
  358.  
  359. BOOL hsc_set_reldir(HSCPRC * hp, STRPTR dir)
  360. {
  361. #if 0
  362.     set_estr(hp->reldir, dir);
  363.     /* append "/" if neccessary */
  364.     link_fname(hp->reldir, estr2str(hp->reldir), "");
  365.     D(fprintf(stderr, DHL "reldir =`%s'\n", estr2str(hp->reldir)));
  366. #endif
  367.     /* append "/" if neccessary */
  368.     link_fname(hp->reldir, dir, "");
  369.     D(fprintf(stderr, DHL "reldir =`%s'\n", estr2str(hp->reldir)));
  370.  
  371.     return (TRUE);
  372. }
  373.  
  374. BOOL hsc_set_iconbase(HSCPRC * hp, STRPTR uri)
  375. {
  376.     set_estr(hp->iconbase, uri);
  377.  
  378.     /* append "/" if neccessary
  379.      * NOTE: in this case link_fname can't be used because
  380.      * hp->iconbase refers to an URI, but not to a file
  381.      */
  382.     if (strlen(uri))
  383.     {
  384.         char lastch = uri[strlen(uri) - 1];
  385.         if (lastch != '/')
  386.             app_estrch(hp->iconbase, '/');
  387.     }
  388.     D(fprintf(stderr, DHL "iconbase=`%s'\n", estr2str(hp->iconbase)));
  389.  
  390.     return (TRUE);
  391. }
  392.  
  393. #if 0 /* TODO: remove */
  394. BOOL hsc_set_filename_project(HSCPRC * hp, STRPTR filename)
  395. {
  396.     BOOL ok = FALSE;
  397.  
  398.     D(fprintf(stderr, DHL "project =`%s'\n", filename));
  399.     ok = hsc_project_set_filename(hp->project, filename);
  400.  
  401.     return (ok);
  402. }
  403. #endif
  404.  
  405. BOOL hsc_set_filename_document(HSCPRC * hp, STRPTR filename)
  406. {
  407.     BOOL ok = FALSE;
  408.  
  409.     D(fprintf(stderr, DHL "document=`%s'\n", filename));
  410.     hp->filename_document = strclone( filename );
  411.  
  412.     return (ok);
  413. }
  414.  
  415. /*
  416.  * set flags
  417.  */
  418. VOID hsc_set_chkid(HSCPRC * hp, BOOL new_chkid)
  419. {
  420.     hp->chkid = new_chkid;
  421.     D(fprintf(stderr, DHL "flag: chkid    =%d\n", new_chkid));
  422. }
  423.  
  424. VOID hsc_set_chkuri(HSCPRC * hp, BOOL new_chkuri)
  425. {
  426.     hp->chkuri = new_chkuri;
  427.     D(fprintf(stderr, DHL "flag: chkuri   =%d\n", new_chkuri));
  428. }
  429.  
  430. VOID hsc_set_compact(HSCPRC * hp, BOOL new_compact)
  431. {
  432.     hp->compact = new_compact;
  433.     D(fprintf(stderr, DHL "flag: compact  =%d\n", new_compact));
  434. }
  435.  
  436. VOID hsc_set_debug(HSCPRC * hp, BOOL new_debug)
  437. {
  438.     hp->debug = new_debug;
  439.     D(fprintf(stderr, DHL "flag: debug    =%d\n", new_debug));
  440. }
  441.  
  442. VOID hsc_set_getsize(HSCPRC * hp, BOOL new_getsize)
  443. {
  444.     hp->getsize = new_getsize;
  445.     D(fprintf(stderr, DHL "flag: getsize  =%d\n", new_getsize));
  446. }
  447.  
  448. VOID hsc_set_htmlonly(HSCPRC * hp, BOOL new_htmlonly)
  449. {
  450.     hp->htmlonly = new_htmlonly;
  451.     D(fprintf(stderr, DHL "flag: htmlonly =%d\n", new_htmlonly));
  452. }
  453.  
  454. VOID hsc_set_jens(HSCPRC * hp, BOOL new_jens)
  455. {
  456.     hp->jens = new_jens;
  457.     D(fprintf(stderr, DHL "flag: jens     =%d\n", new_jens));
  458. }
  459.  
  460. VOID hsc_set_jerkvalues(HSCPRC * hp, BOOL new_jerkvalues)
  461. {
  462.     hp->jerkvalues = new_jerkvalues;
  463.     D(fprintf(stderr, DHL "flag: jerkval  =%d\n", new_jerkvalues));
  464. }
  465.  
  466. VOID hsc_set_rplc_ent(HSCPRC * hp, BOOL new_rplc_ent)
  467. {
  468.     hp->rplc_ent = new_rplc_ent;
  469.     D(fprintf(stderr, DHL "flag: rplc_ent =%d\n", new_rplc_ent));
  470. }
  471.  
  472. VOID hsc_set_rplc_quote(HSCPRC * hp, BOOL new_rplc_quote)
  473. {
  474.     hp->rplc_quote = new_rplc_quote;
  475.     D(fprintf(stderr, DHL "flag: rplc_quote =%d\n", new_rplc_quote));
  476. }
  477.  
  478. VOID hsc_set_smart_ent(HSCPRC * hp, BOOL new_smart_ent)
  479. {
  480.     hp->smart_ent = new_smart_ent;
  481.     D(fprintf(stderr, DHL "flag: smart_ent=%d\n", new_smart_ent));
  482. }
  483.  
  484. VOID hsc_set_strip_cmt(HSCPRC * hp, BOOL new_strip_cmt)
  485. {
  486.     hp->strip_cmt = new_strip_cmt;
  487.     D(fprintf(stderr, DHL "flag: strip_cmt=%d\n", new_strip_cmt));
  488. }
  489.  
  490. VOID hsc_set_strip_ext(HSCPRC * hp, BOOL new_strip_ext)
  491. {
  492.     hp->strip_ext = new_strip_ext;
  493.     D(fprintf(stderr, DHL "flag: strip_ext=%d\n", new_strip_ext));
  494. }
  495.  
  496. /*
  497.  * set flags
  498.  */
  499. VOID hsc_set_quote_mode(HSCPRC * hp, LONG new_mode)
  500. {
  501.     hp->quotemode = new_mode;
  502.     D(fprintf(stderr, DHL "quote_mode=%ld\n", new_mode));
  503. }
  504.  
  505. VOID hsc_set_entity_mode(HSCPRC * hp, LONG new_mode)
  506. {
  507.     hp->entmode = new_mode;
  508.     D(fprintf(stderr, DHL "entity_mode=%ld\n", new_mode));
  509. }
  510.  
  511. /*
  512.  * set call-backs
  513.  */
  514. VOID hsc_set_status_file_begin(HSCPRC * hp, VOID(*status_file) (HSCPRC * hp, STRPTR filename))
  515. {
  516.     hp->CB_status_file_begin = status_file;
  517. }
  518.  
  519. VOID hsc_set_status_file_end(HSCPRC * hp, VOID(*status_file) (HSCPRC * hp))
  520. {
  521.     hp->CB_status_file_end = status_file;
  522. }
  523.  
  524. VOID hsc_set_status_line(HSCPRC * hp, VOID(*status_line) (HSCPRC * hp))
  525. {
  526.     hp->CB_status_line = status_line;
  527. }
  528.  
  529. VOID hsc_set_status_misc(HSCPRC * hp, VOID(*status_misc) (HSCPRC * hp, STRPTR s))
  530. {
  531.     hp->CB_status_misc = status_misc;
  532. }
  533.  
  534. VOID hsc_set_message(
  535.                         HSCPRC * hp,
  536.                         VOID(*message) (struct hscprocess * hp,
  537.                                         HSCMSG_CLASS msg_class, HSCMSG_ID,
  538.                                         STRPTR fname, ULONG x, ULONG y,
  539.                                         STRPTR msg_text))
  540. {
  541.     hp->CB_message = message;
  542. }
  543.  
  544. VOID hsc_set_message_ref(
  545.                             HSCPRC * hp,
  546.                             VOID(*message_ref) (struct hscprocess * hp,
  547.                                    HSCMSG_CLASS msg_class, HSCMSG_ID msg_id,
  548.                                              STRPTR fname, ULONG x, ULONG y,
  549.                                                 STRPTR msg_text))
  550. {
  551.     hp->CB_message_ref = message_ref;
  552. }
  553.  
  554. VOID hsc_set_start_tag(HSCPRC * hp,
  555.                        VOID(*start_tag) (struct hscprocess * hp,
  556.           HSCTAG * tag, STRPTR tag_name, STRPTR tag_attr, STRPTR tag_close))
  557. {
  558.     hp->CB_start_tag = start_tag;
  559. }
  560.  
  561. VOID hsc_set_end_tag(HSCPRC * hp,
  562.                      VOID(*end_tag) (struct hscprocess * hp,
  563.           HSCTAG * tag, STRPTR tag_name, STRPTR tag_attr, STRPTR tag_close))
  564. {
  565.     hp->CB_end_tag = end_tag;
  566. }
  567.  
  568. VOID hsc_set_text(HSCPRC * hp,
  569.                   VOID(*text) (struct hscprocess * hp,
  570.                                STRPTR white_spaces, STRPTR text))
  571. {
  572.     hp->CB_text = text;
  573. }
  574.  
  575. VOID hsc_set_id(HSCPRC * hp,
  576.                 VOID(*id) (struct hscprocess * hp,
  577.                            HSCATTR * attr, STRPTR id))
  578. {
  579.     hp->CB_id = id;
  580. }
  581.  
  582. /*
  583.  * message methodes
  584.  */
  585. BOOL hsc_set_msg_ignore(HSCPRC * hp, HSCMSG_ID msg_id, BOOL value)
  586. {
  587.     BOOL set = FALSE;
  588.  
  589.     if ((msg_id & MASK_MESSAGE) <= MAX_MSGID)
  590.         hp->msg_ignore[msg_id & MASK_MESSAGE] = value;
  591.  
  592.     return (set);
  593. }
  594.  
  595. BOOL hsc_get_msg_ignore(HSCPRC * hp, HSCMSG_ID msg_id)
  596. {
  597. /*    HSCMSG_ID max_msgid = MAX_MSGID; */
  598.     if ((msg_id & MASK_MESSAGE) <= MAX_MSGID)
  599.         return (hp->msg_ignore[msg_id & MASK_MESSAGE]);
  600.     else
  601.         return (FALSE);
  602. }
  603.  
  604. BOOL hsc_set_msg_class(HSCPRC * hp, HSCMSG_ID msg_id, HSCMSG_CLASS msg_class)
  605. {
  606.     BOOL set = FALSE;
  607.  
  608.     if ((msg_id & MASK_MESSAGE) <= MAX_MSGID)
  609.         hp->msg_class[msg_id & MASK_MESSAGE] = msg_class;
  610.  
  611.     return (set);
  612. }
  613.  
  614. HSCMSG_CLASS hsc_get_msg_class(HSCPRC * hp, HSCMSG_ID msg_id)
  615. {
  616.     if ((msg_id & MASK_MESSAGE) <= MAX_MSGID)
  617.     {
  618.         HSCMSG_CLASS mchp = hp->msg_class[msg_id & MASK_MESSAGE];
  619.         HSCMSG_CLASS mcid = msg_id & MASK_MSG_CLASS;
  620.  
  621.         if (mcid > mchp)
  622.             return (mcid);
  623.         else
  624.             return (mchp);
  625.     }
  626.     else
  627.         return (MSG_NONE);
  628. }
  629.  
  630. VOID hsc_clear_msg_ignore(HSCPRC * hp)
  631. {
  632.     size_t i;
  633.     for (i = 0; i <= MAX_MSGID; i++)
  634.         hp->msg_ignore[i] = FALSE;
  635. }
  636.  
  637. VOID hsc_reset_msg_class(HSCPRC * hp)
  638. {
  639.     size_t i;
  640.     for (i = 0; i <= MAX_MSGID; i++)
  641.         hp->msg_class[i] = MSG_NONE;
  642. }
  643.  
  644. /*
  645.  * output text function
  646.  *
  647.  * output text to
  648.  *
  649.  * params: hp....hsc process to perform ouput with
  650.  *         wspc..white spaces
  651.  *         text..other text
  652.  * result: true, if text has been outputted
  653.  */
  654. BOOL hsc_output_text(HSCPRC * hp, STRPTR wspc, STRPTR text)
  655. {
  656.     BOOL written = FALSE;
  657.     if ((hp)->CB_text && !((hp)->suppress_output))
  658.     {
  659.         (*((hp)->CB_text)) ((hp), wspc, text);
  660. #if DEBUG_HSCLIB_OUTPUT
  661.         if (hp->debug)
  662.             if (text)
  663.                 if (strcmp(text, "\n"))
  664.                     fprintf(stderr, DHL "ouput: `%s', `%s'\n", wspc, text);
  665.                 else
  666.                     fprintf(stderr, DHL "ouput: `%s', `\\n'\n", wspc);
  667. #endif
  668.         written = TRUE;
  669.     }
  670.     return (written);
  671. }
  672.  
  673. /*
  674.  * misc. functions
  675.  */
  676.  
  677. /*
  678.  * nomem-handler
  679.  */
  680. BOOL hsc_standard_nomem_handler(size_t size)
  681. {                               /* TODO: think about this */
  682.     fputs("\n*** out of memory\n\n", stderr);
  683.  
  684.     exit(RC_FAIL);
  685.  
  686.     return (FALSE);             /* abort immediatly */
  687. }
  688.  
  689.